<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class TRealdataSwdi extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_realdata_SWDI', function (Blueprint $table) {
             $table->engine = 'MEMORY';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->datetime('rd_updatetime')->nullable(false)->comment('');
			$table->unsignedInteger('pdi_index')->nullable(false)->default(0)->comment('');
			$table->boolean('rd_SWDI1')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI2')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI3')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI4')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI5')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI6')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI7')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI8')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI9')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI10')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI11')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI12')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI13')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI14')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI15')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDI16')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO1')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO2')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO3')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO4')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO5')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO6')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO7')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO8')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO9')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO10')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO11')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO12')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO13')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO14')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO15')->nullable()->default(0)->comment('');
			$table->boolean('rd_SWDO16')->nullable()->default(0)->comment('');
			$table->boolean('rd_NetCom')->nullable()->default(0)->comment('');
			$table->unique('pdi_index', 'pdi_index');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_realdata_SWDI');
    }
}
